# Contributor: Minecrell <minecrell@minecrell.net>
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=neard
pkgver=0.16
pkgrel=1
pkgdesc="Near Field Communication manager"
url="https://01.org/linux-nfc/"
arch="all"
license="GPL-2.0-only"
depends="dbus"
makedepends="glib-dev dbus-dev libnl-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
source="
	https://cdn.kernel.org/pub/linux/network/nfc/$pkgname-$pkgver.tar.xz
	neard.initd
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-systemd \
		--enable-tools
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# Avoid conflicts with other packages
	mv "$pkgdir"/usr/include/version.h "$pkgdir"/usr/include/near/version.h

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

sha512sums="d0fd5dcfd19db64e65e4149c76979bc7a438240aa6840b35059fde41a8a84a2424274577de964a925e76cd013d21796f69f5361012b6ac79c546d0abdcfed2a6  neard-0.16.tar.xz
6e28ffa74687cc409856d8966d9e794e523254781133e61adb81007ed00b7f057122ca8dfa967684312a613e9a3898865844320e4302990046d871a0a9b66eb5  neard.initd"
